package com.grm.demo.xiancheng;

public class MyRunnable implements Runnable{
    @Override
    public void run() {
        System.out.println(Thread.currentThread().getName() + "正在运行");
    }

    public static void main(String[] args) {
        MyRunnable myRunnable = new MyRunnable();
        Thread thread = new Thread(myRunnable);
        thread.start();
        // lambda表达式简写
        new Thread(() -> {
            System.out.println(Thread.currentThread().getName() + "正在运行");
        }).start();
    }
}
